<div>
    <h2 id="page-heading">
        <span>Deliver Offers</span>
        <button id="jh-create-entity" class="btn btn-primary float-right jh-create-entity create-deliver-offer" [routerLink]="['/deliver-offer/new']">
            <fa-icon [icon]="'plus'"></fa-icon>
            <span >
            Create new Deliver Offer
            </span>
        </button>
    </h2>
    <jhi-alert></jhi-alert>
    <br/>
    <div class="table-responsive" *ngIf="deliverOffers">
        <table class="table table-striped">
            <thead>
            <tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="reset.bind(this)">
            <th jhiSortBy="id"><span>ID</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="userId"><span>User Id</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="from"><span>From</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="toPl"><span>To Pl</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="location"><span>Location</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="leaveDate"><span>Leave Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="arriveDate"><span>Arrive Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="transportType"><span>Transport Type</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="status"><span>Status</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th jhiSortBy="createdDate"><span>Created Date</span> <fa-icon [icon]="'sort'"></fa-icon></th>
            <th></th>
            </tr>
            </thead>
            <tbody infinite-scroll (scrolled)="loadPage(page + 1)" [infiniteScrollDisabled]="page >= links['last']" [infiniteScrollDistance]="0">
            <tr *ngFor="let deliverOffer of deliverOffers ;trackBy: trackId">
                <td><a [routerLink]="['/deliver-offer', deliverOffer.id, 'view' ]">{{deliverOffer.id}}</a></td>
                <td>{{deliverOffer.userId}}</td>
                <td>{{deliverOffer.from}}</td>
                <td>{{deliverOffer.toPl}}</td>
                <td>{{deliverOffer.location}}</td>
                <td>{{deliverOffer.leaveDate | date:'medium'}}</td>
                <td>{{deliverOffer.arriveDate | date:'medium'}}</td>
                <td>{{deliverOffer.transportType}}</td>
                <td>{{deliverOffer.status}}</td>
                <td>{{deliverOffer.createdDate | date:'medium'}}</td>
                <td class="text-right">
                    <div class="btn-group flex-btn-group-container">
                        <button type="submit"
                                [routerLink]="['/entity/deliver-offer', deliverOffer.id, 'view' ]"
                                class="btn btn-info btn-sm">
                            <fa-icon [icon]="'eye'"></fa-icon>
                            <span class="d-none d-md-inline">View</span>
                        </button>
                        <button type="submit"
                                [routerLink]="['/entity/deliver-offer', deliverOffer.id, 'edit']"
                                class="btn btn-primary btn-sm">
                            <fa-icon [icon]="'pencil-alt'"></fa-icon>
                            <span class="d-none d-md-inline">Edit</span>
                        </button>
                        <button (click)="deleteOffer(deliverOffer)"
                                class="btn btn-danger btn-sm">
                            <fa-icon [icon]="'times'"></fa-icon>
                            <span class="d-none d-md-inline">Delete</span>
                        </button>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </div>
</div>
